public class Circle {
	private double r;

	public void setR(double r) {
		if (r <= 0) {
			RuntimeException exception = new IllegalArgumentException(
					"圆的半径应大于0!");
			throw exception;
		} else {
			this.r = r;
		}
	}

	public double getArea() {
		return Math.PI * r * r;
	}

	/**
	 * 
	 * @param r
	 * @return
	 * @throws Exception
	 */
	public static double getArea(int r) throws Exception {
		if (r <= 0) {
			Exception exception = new Exception("Exception,圆的半径应大于0!");
			throw exception;

		} else {
			return Math.PI * r * r;
		}
	}

	/**
	 * 
	 * @param r
	 * @return
	 * @throws CircleException
	 */
	public static double getArea(double r) throws CircleException {
		if (r <= 0) {
			CircleException exception = new CircleException(
					"CircleException,圆的半径应大于0!");
			throw exception;
		} else {
			return Math.PI * r * r;
		}
	}

}
